package com.hackathon.chgk.utils;

public class AnswerComparer {
	public static boolean match(String answer, String correct){ 
		String[] res = answer.split(" ");
		String trimedAnswer = "";
		for (int x=0; x<res.length; x++)
			 trimedAnswer += res[x].trim();
	     
		String[] res2 = correct.split(" ");
		String trimedCorrect = "";
		for (int x=0; x<res2.length; x++)
			trimedCorrect += res2[x].trim();
		if (trimedCorrect != "")
			trimedCorrect = trimedCorrect.substring(0, trimedCorrect.length()-1);
		
		return trimedCorrect.equalsIgnoreCase(trimedAnswer);
	}
}
